﻿using Common.Enum;
using DryWCS.Model.Conveyor;
using DryWCS.Model.Enum;
using DryWCS.Service.DbContext;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DryWCS.Service.Conveyor
{
    public class ConveyorService : LocalDbContext<ConveyorTaskModel>
    {
        public ConveyorTaskModel GetFirstByStatus(TaskStatusEnum taskStatusEnum)
        {
            try
            {
                return Db.Queryable<ConveyorTaskModel>().Where(p => p.Status == taskStatusEnum && p.IsLock == false).First();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
